

SCIPTDIR=$(cd $(dirname "$0") && pwd -P)
cd $SCIPTDIR/../deploy/


cp -rf jdk-8u91-linux-x64.tar.gz ../dashub/
unzip -d ../dashub/dir/ ../../../dist/apm.server-3.0.0-SNAPSHOT-threshold_das.zip
\cp -f configure.properties ../dashub/dir/conf/
\cp -f jdbc.properties ../dashub/dir/conf/
\cp -f threshold_start.sh ../dashub/dir/threshold/bin/start.sh


unzip -d hub ../../../dist/apm.server-3.0.0-SNAPSHOT-hub.zip
cp -rf hub/hub/ ../dashub/dir/


cp -rf jdk-8u91-linux-x64.tar.gz ../brokertcpreplaycollect/
unzip -d ../brokertcpreplaycollect/collect/dir/ ../../../dist/apm.server-3.0.0-SNAPSHOT-collect.zip
cp -rf ../dashub/dir/conf/ ../brokertcpreplaycollect/collect/dir/
\cp -f server.properties ../brokertcpreplaycollect/collect/dir/indicator/conf/


cp -rf jdk-8u91-linux-x64.tar.gz ../console/
unzip -d ../console/dir/ ../../../dist/apm.server-3.0.0-SNAPSHOT-web_manager_console.zip
\cp -f configure.properties ../console/dir/conf/
\cp -f jdbc.properties ../console/dir/conf/
\cp -rf console_start.sh ../console/dir/bin/start.sh


tar -zxvf Broadview_APM_M4.tar.gz -C ../brokertcpreplaycollect/broker/dir/

docker rmi -f dockerhub.uyuntest.cn:5000/apm/dashub
docker rmi -f dockerhub.uyuntest.cn:5000/apm/brokertcpreplaycollect
docker rmi -f dockerhub.uyuntest.cn:5000/apm/console

cd ../dashub/
docker build -t dockerhub.uyuntest.cn:5000/apm/dashub .
docker push dockerhub.uyuntest.cn:5000/apm/dashub

cd ../brokertcpreplaycollect
docker build -t dockerhub.uyuntest.cn:5000/apm/brokertcpreplaycollect .
docker push dockerhub.uyuntest.cn:5000/apm/brokertcpreplaycollect

cd ../console
docker build -t dockerhub.uyuntest.cn:5000/apm/console .
docker push dockerhub.uyuntest.cn:5000/apm/console












